package com.example.tutormanagement.controller;

import com.example.tutormanagement.pojo.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * &#064;Date: 23/06/14-16:26
 * &#064;Description: 登录
 */
@RestController
@CrossOrigin
public class AuthController {

    @GetMapping("/auth")
    public Result Auth(String username, String pwd) {
        if (username.equals("admin") && pwd.equals("admin")) {
            //返回令牌
            String token = "auth";
            return Result.success(token);
        } else
            return Result.error("failure");
    }
}
